/* rcabsccf.p - UPDATE CONFIRM FLAG FOR CONTAINER AND LINE CHARGES */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.1 $                                                     */
/*                                                                      */
/* $Revision: 1.1 $      BY: Dan Herman    DATE: 08/15/01   ECO: *P01L* */
/*V8:ConvertMode=NoConvert                                              */
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */

/*------------------------------------------------------------------------
Purpose:       Update the confirm flag in Shipment Detail Line Charges
               (absl_det), and in Sales Order Detail Container Charges
               (abscc_det).

Exceptions:    None
Conditions:
Pre:           Container and Line Charges must be enabled.
Post:
Notes:         If not in confirm mode, (unconfirming the shipper) then
               we need to set the invoice post flag to no, so that the
               values will be included on the next invoice.

History:

Inputs:
pAbsID          (character)
pShipFrom       (character)
pConfirm        (logical)
pLineCharge     (logical)


Outputs:

----------------------------------------------------------------------------*/

{mfdeclre.i}

define input parameter pAbsID       as character no-undo.
define input parameter pShipFrom    as character no-undo.
define input parameter pConfirm     as logical no-undo.
define input parameter pPost        as logical no-undo.
define input parameter pLineCharge  as logical no-undo.


if pLineCharge then do:

   for each absl_det where
      absl_abs_id = pAbsID and
      absl_abs_shipfrom = pShipFrom
   exclusive-lock:
      absl_confirmed = pConfirm.
      if not pConfirm then absl_inv_post = false.
      if not pconfirm and pPost then absl_inv_nbr = "".
   end.

end. /* if pLineCharge */

else do:

   for each abscc_det where
      abscc_abs_id = pAbsID and
      abscc_abs_shipfrom = pShipFrom
   exclusive-lock:
      abscc_confirmed = pConfirm.
      if not pConfirm then abscc_inv_post = false.
      if not pconfirm and pPost then abscc_inv_nbr = "".
   end.

end.
